<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
#div1{width:200px;height:200px;border:1px solid black;}
</style>
<script>
window.onload=function()
{
	var oTxt=document.getElementById('txt');
	var oBtn=document.getElementById('btn');
	var oDiv=document.getElementById('div1');
	
	oBtn.onclick=function()
	{
		alert(oTxt.innerHTML);
		//oDiv.innerHTML=oTxt.value;
		//innerHTML解析：oDiv里面的HTMl
	}
}
</script>
</head>

<body>
<input id="txt" type="text" />
<input id="btn" type="button" value="设置文字" />
<div id="div1">
这是
</div>
</body>
</html>
